home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14407 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Check if a file exists?
  5. Date: 14 Apr 1996 09:22:01 -0700
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4kr8n9INN4he@keats.ugrad.cs.ubc.ca>
  8. References: <4kp7pg$upe@news-s01.ny.us.ibm.net> <829481378snz@genesis.demon.co.uk>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <829481378snz@genesis.demon.co.uk>,
  12. Lawrence Kirby  <fred@genesis.demon.co.uk> wrote:
  13. >In article <4kp7pg$upe@news-s01.ny.us.ibm.net>
  14. >           bfilone@ibm.net "bfilone@ibm.net " writes:
  15. >
  16. >>Is it possible in C to check if a file exists other than checking for a
  17. >> succesful fopen?
  18. >
  19. >There is no other way in standard C. The only standard C library functions
  20. >that actually take a filename are fopen, freopen, rename and remove.
  21.  
  22. But even so, Lawrence, how can you be sure that a successful fopen() means that
  23. the file really *exists*? Do computers exist?
  24.  
  25. It seems that one has to approach fopen() with a certain metaphysical
  26. predisposition that a file really *can* exist.
  27.  
  28. The proper discussion of file existence is to be found somewhere in alt.kooks
  29. and not comp.lang.c. As far as the standard is concerned, all that fopen()
  30. means is that certain things are logically possible that wouldn't be if fopen()
  31. failed. Assuming fopen() exists, of course. But that is off topic.
  32.  
  33. :))
  34.